<div class="main-content">
	<div class="breadcrumbs" id="breadcrumbs">
		<script type="text/javascript">
			try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
		</script>

		<ul class="breadcrumb">
			<li>
				<i class="icon-home home-icon"></i>
				<a href="#">系统首页</a>
			</li>
			<li class="active">
				活动管理
			</li>
            <li class="active">
				线下商户二维码生成
			</li>
		</ul><!-- .breadcrumb -->
	</div>
	<!-- Main content -->
    <div class="page-content">
    	<div class="row">
    	    <div class="page-header">
    			<h1>线下商户二维码生成</h1>
    		</div>
    		<script>
			function submit_form(){
				if($('#qr_num').val()>500){
				
					alert('一次最多生成500张');
					return false;
				}
				return true;
			}
			
			</script>
            <div class=" col-md-12 col-sm-12 col-xs-12 form">
                <div class="row">
                <form action="<?php echo base_url().'admin/activity/generate_code'?>" method="post"  target="_blank" onsubmit="return submit_form();">
                	<div class="wh">
                    	<label>二维码数量：</label>
                        <input type="text"  name="qr_num" id="qr_num" value=""/>
                   </div>
                   
                    <div class="wh">
						<button class="btn btn-sm btn-info" type="submit"><i class="icon-search"></i>生成</button>
                    </div>
                </form>
                </div>
			</div>
			
			<div class="col-xs-12 margin_t margin_b">
				<div class="table-responsive  tab">
				<form action="<?php echo base_url()."admin/activity/del_some_activity"?>" method="post" id="delForm">
					<table id="sample-table-1" class="table table-striped table-bordered table-hover">
						<thead>
							<tr>
								
								
								<th>id</th>
                                <th>绑定状态</th>
								<th>绑定手机号</th>
								<th>绑定时间</th>
							</tr>
						</thead> 
						<tbody>
						<?php if (isset($result)&&count($result)>0){
                            	foreach ($result as $device){
                            	?>
							<tr>
								
								<td><p><?php echo $device->id;?></p></td>
								<td><p><?php if($device->used==1){echo '已绑定';}else{echo '未绑定';};?></p></td>
								<td><p><?php echo $device->user_phone;?></p></td>
								<td><p><?php echo $device->bind_time;?></p></td>
                                </tr>
    						<?php }
                            }else{?>
                            <tr>
                            	<td colspan="12">无数据</td>
                            </tr>
                            <?php }?>
                            </tbody>
                         </table>
                     </form>
                     </div><!-- /.table-responsive -->
            	</div>
            	<div class="col-sm-12">
                	<div class="modal-footer no-margin-top">
	                	<div class="pull-left record">
							共<?php echo $count;?>条记录
	                    </div>
                		<?php if (isset($page))echo $page;?>
                	</div>
                </div>
			
            	
            </div><!-- /.row -->
		</div><!-- /.page-content -->
	</div><!-- /.main-content -->
	
	
	
	
	
